<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关闭二维码案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .code {
            position: relative;
            height: 160px;
            width: 160px;
            margin: 100px auto;
            padding: 5px;
            border: 1px solid #ef4f2a;
        }
        .close {
            position: absolute;
            width: 10px;
            height: 10px;
            line-height: 10px;
            font-size: 10px;
            top: -1px;
            left: -12px;
            font-style: normal;
            color: #ef4f2a;;
            border: 1px solid #ef4f2a;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="code">
        <img src="images/tao.png" alt="">
        <i class="close">×</i>
    </div>
    <script>
        var btn = document.querySelector('.close');
        var code = document.querySelector('.code');

        btn.onclick = function(){
            code.style.display = 'none';
        }
    </script>
</body>
</html>